	$(function(){
        //按钮单击时执行
        $("#admin_system_add_do").click(function(){
			toastr.options = {
			  "closeButton": true,
			  "debug": false,
			  "progressBar": true,
			  "positionClass": "toast-bottom-full-width",
			  "onclick": null,
			  "showDuration": "400",
			  "hideDuration": "1000",
			  "timeOut": "7000",
			  "extendedTimeOut": "1000",
			  "showEasing": "swing",
			  "hideEasing": "linear",
			  "showMethod": "fadeIn",
			  "hideMethod": "fadeOut"
			}
			//输入验证
            if($("#sub_name").val() == ""){  
                toastr.warning("模块名称不能为空！");  
                $("#sub_name").focus();  
                return false;  
            }  
			if($("#sub_access").val() == ""){  
                toastr.warning("模块标识不能为空！");  
                $("#sub_access").focus();  
                return false;  
            }
			//js验证 `~!@#$^&*()=|{}':;',\\[\\].<>/?~！@#￥……&*（）——|{}【】‘；：”“'。，、？  
            var pattern = new RegExp("[~'!@#$%^&*()-+_=:]");  
            if($("#sub_access").val() != "" && $("#sub_access").val() != null){  
                if(pattern.test($("#sub_access").val())){  
                    toastr.error("模块标识格式不正确！");  
                    $("#sub_access").focus();  
                    return false;  
                }  
            }
			var sub_type = $('#sub_type option:selected').val();
			var sub_name = $('#sub_name').val();
			var sub_access = $('#sub_access').val();
            //Ajax调用处理
            var admin_system_add = $.ajax({
               type: "POST",
               url: "index.php?m=system&c=system_admin&a=admin_system_add_do",
               data: "sub_type="+sub_type+"&sub_name="+sub_name+"&sub_access="+sub_access,
               async: false
            }).responseText;
			if (admin_system_add == "1"){
				toastr.info("模块标识已存在，请核对后重新提交！");
			} else if (admin_system_add == "2") {
				toastr.success("恭喜您："+sub_name+" ，模块添加成功！");
			} else {
				toastr.error("请勿提交非法数据！");
			}
         });		 
    });